// 关联数据库 graduation-project
const mongoose = require('mongoose');
const userModel = require('./userModel');
const addressSchema = new mongoose.Schema({
    name: String, // 收件人姓名
    phone: String, // 收件电话
    site: String, // 收件地址
    tag: String, // 标签
    isDefault: Boolean, // 是否默认地址
    // 关联用户
    userId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: userModel

    },
});
// admins : 关联的数据库的集合
module.exports = mongoose.model("addressModel", addressSchema, 'addresses');